package com.lecyon.farm.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lecyon.farm.base.BaseRequestPageVo;
import com.lecyon.farm.base.RestResponse;
import com.lecyon.farm.service.IFmWorkDetailsService;
import com.lecyon.farm.vo.query.QueryFmWorkDetailsVo;
import com.lecyon.farm.vo.view.FmWorkDetailsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @author YaoZheng
 * @since 2020-04-02
 */
@RestController
@RequestMapping("/fm-work-details")
@Api(tags = "农机当季作业详情")
@ResponseBody
@CrossOrigin
public class FmWorkDetailsController {

    private IFmWorkDetailsService fmWorkDetailsService;

    @Autowired
    public FmWorkDetailsController(IFmWorkDetailsService fmWorkDetailsService) {
        this.fmWorkDetailsService = fmWorkDetailsService;
    }

    @ApiOperation(value = "查询作业明细列表(F0101)", notes = "查询作业明细列表(分页)，author:YaoZheng")
    @PostMapping(value = "/getList")
    public RestResponse<Page<FmWorkDetailsVo>> getPageList(@RequestBody @Valid BaseRequestPageVo<QueryFmWorkDetailsVo> vo) {
        return fmWorkDetailsService.getPageList(vo);
    }
}
